package com.one.consumer.reserve.presenter;

import android.content.Context;

import com.one.common.model.http.base.BaseModel;
import com.one.common.model.http.callback.ObserverOnResultListener;
import com.one.common.presenter.BaseApiPresenter;
import com.one.common.view.base.BaseActivity;
import com.one.common.view.base.IListView;
import com.one.common.view.base.IView;
import com.one.consumer.reserve.model.ReserveModel;
import com.one.consumer.reserve.model.item.CustomProjectItem;

import java.util.ArrayList;

/**
 * author ：zhulunjun
 * email  ：zhulunjun@qq.com
 * date   ：2018/10/24 下午10:12
 * description ：项目列表
 **/
public class CustomProjectPresenter extends BaseApiPresenter<IListView, ReserveModel> {


    public CustomProjectPresenter(IListView mView, Context mContext) {
        super(mView, mContext, new ReserveModel((BaseActivity) mContext));
    }

    /**
     * 加载项目列表
     */
    public void getProjectList(){
        mModel.getCutomProjectList(mView.getPage() + "", new ObserverOnResultListener<ArrayList<CustomProjectItem>>() {
            @Override
            public void onResult(ArrayList<CustomProjectItem> customProjectItems) {
                if(mView!=null){
                    mView.loadSuccess(customProjectItems);
                }

            }
        });
    }
}
